import {baseRequest} from '@/utils/request'

const request = (url, ...arg) => baseRequest(`/api/config/` + url, ...arg)


export default {
	async saveApiConfig(data) {
		return await request(`save`, data, 'post')
	},
	async apiList(data) {
		return await request(`list`, data, 'post')
	},
	async queryApiById(id) {
		return await request(`query_by_id`, {id}, 'post')
	},
	async queryApiVersionList(id) {
		return await request(`version/query_by_api_id`, {id}, 'post')
	},
	async removeById(id){
		return await request(`remove_by_id`, {id}, 'post')
	},
	async updateApiById(data) {
		return await request(`update_by_id`, data, 'post')
	},
	async updateApiStatusCode(id, apiStatusCode) {
		return await request(`set_api_status_code`, {
			id,
			apiStatusCode
		}, 'post')
	},
	async updateApiVersionLatestFlag(id, latestFlag) {
		return await request(`version/set_latest_flag`,{
			id,
			latestFlag
		}, 'post')
	},
	async queryDefaultResponseWrapper() {
		return await request(`get_default_response_wrapper`,{}, 'post')
	}
	,async aiGenerateProcessFile(data){
		return await request('ai_generate_process_file', data, 'post')
	}
}

